import {User} from './entities/user.entity';
import {SysUserWithRoleEntity} from './entities/user.role.entity';
import { UserController } from './user.controller';
import { UserService } from './user.service';
import { Module, Global } from '@nestjs/common';
import { TypeOrmModule } from '@nestjs/typeorm';
import { JwtModule } from '@nestjs/jwt';
import { ConfigModule, ConfigService } from '@nestjs/config';
@Global()
@Module({
  imports: [
    TypeOrmModule.forFeature([User, SysUserWithRoleEntity]),
    // JwtModule.registerAsync({
    //   imports: [ConfigModule],
    //   useFactory: async (config: ConfigService) => ({
    //     secret: config.get('jwt.secretkey'),
    //   }),
    //   inject: [ConfigService],
    // }),
  ],
  controllers: [UserController],
  providers: [UserService],
  exports: [UserService],
})
export class UserModule {}